package com.yeyks.dal.dao;

import com.yeyks.dal.domain.UserCouponInfo;
import com.yeyks.dto.UserCouponResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserCouponInfoMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(UserCouponInfo record);

    UserCouponInfo selectByPrimaryKey(Integer id);

    List<UserCouponInfo> selectAll();

    int updateByPrimaryKey(UserCouponInfo record);

    int insertReturnId(UserCouponInfo record);

    int countOfUserIdCouponId(UserCouponInfo info);

    int countOfUserIdCouponId(@Param("userId") Integer userId, @Param("couponId") Integer couponId);

    List<Map> selectValid(@Param("couponId") Integer couponId, @Param("hotelId") Integer hotelId);

    int deleteByCouponId(@Param("couponId") Integer couponId);

    List<UserCouponInfo> selectUnusedByCouponId(@Param("couponId") Integer couponId);

    int updateUsed(@Param("couponId") Integer couponId);

    List<UserCouponResult> selectUserCouponList(Map<String, Object> map);

    Long selectUserCouponListCount(Map<String, Object> map);

    Long selectUserCouponListCountV2(Map<String, Object> map);

    Integer updateCouponUseById(@Param("userCouponId") Integer userCouponId, @Param("use") Boolean use);

    UserCouponInfo selectUserCoupon(@Param("couponId") Integer couponId, @Param("userId") Integer userId);

    UserCouponInfo selectByNewest(Integer userId);
}